package models

// 文件库表

import (
	"time"

	"gorm.io/gorm"
)

// Visit 存储患者的就诊信息
type Visit struct {
	gorm.Model
	JZID          uint      `gorm:"primary_key;auto_increment;not null" json:"jz_id"`
	PatientID     uint      `gorm:"index;not null;foreignKey:PatientID" json:"patient_id"`
	DoctorID      uint      `gorm:"index;not null;foreignKey:DoctorID" json:"doctor_id"`
	VisitTime     time.Time `gorm:"type:timestamp;default:CURRENT_TIMESTAMP" json:"visit_time"`
	Diagnosis     string    `gorm:"type:text" json:"diagnosis"`
	DiagnosisName string    `gorm:"type:varchar(100)" json:"diagnosis_name"`
	Status        string    `gorm:"type:varchar(20);not null" json:"status"`
	IsDeleted     int       `gorm:"not null" json:"is_deleted"`
}

// LabTest 存储检验检查单项目表
type LabTest struct {
	gorm.Model
	LabTestID   string `gorm:"primary_key;type:varchar(20);not null" json:"labtest_id"`
	TestType    string `gorm:"type:varchar(10);not null" json:"test_type"`
	TestName    string `gorm:"type:varchar(50);not null" json:"test_name"`
	TestContent string `gorm:"type:text" json:"test_content"`
	TestUnit    string `gorm:"type:varchar(10)" json:"test_unit"`
}

// WesternMedicline 存储西药信息表
type WesternMedicline struct {
	gorm.Model
	WesternMediclineID   string `gorm:"primary_key;type:varchar(20);not null" json:"western_medicline_id"`
	WesternMediclineName string `gorm:"type:varchar(50);not null" json:"western_medicline_name"`
	Ypjx                 string `gorm:"type:varchar(20)" json:"ypjx"`
	Ypgg                 string `gorm:"type:varchar(100)" json:"ypgg"`
}

// ChineseMedicline 存储中草药信息表
type ChineseMedicline struct {
	gorm.Model
	ChineseMediclineID   string `gorm:"primary_key;type:varchar(20);not null" json:"chinese_medicline_id"`
	ChineseMediclineName string `gorm:"type:varchar(50);not null" json:"chinese_medicline_name"`
	Gxfl                 string `gorm:"type:varchar(20)" json:"gxfl"`
	Gxyl                 string `gorm:"type:varchar(100)" json:"ggyl"`
}

// ICD_10 存储诊断编码表
type ICD_10 struct {
	gorm.Model
	DiagnosisID   string `gorm:"primary_key;type:varchar(20);not null" json:"diagnosis_id"`
	DiagnosisName string `gorm:"type:varchar(100);not null" json:"diagnosis_name"`
}
